<template>
  <div class="happy">
    <div id="main" style="width: 100%; height: 100%"></div>
  </div>
</template>
<script>
import * as echarts from "echarts";
export default {
  name: "happy",
  components: {},
  mounted() {
    this.drawChart();
  },
  created() {},
  data() {
    return {
      option: {
        title: {
          text: "布布一二财富值",
        },
        tooltip: {},
        legend: {
          data: ["金额"],
        },
        xAxis: {
          data: ["2023", "2024", "2025", "2026", "2027", "2028"],
        },
        yAxis: {},
        series: [
          {
            name: "金额",
            type: "bar",
            data: [5000000, 2000000, 3600000, 1000000, 1000000, 2000000],
          },
        ],
      },
    };
  },
  methods: {
    drawChart() {
      let myChart = echarts.init(document.getElementById("main"));
      let option = this.option;
      myChart.setOption(option);
    },
  },
};
</script>
<style scoped>
.happy {
  height: 100%;
  width: 100%;
}
</style>
